import React,{Fragment,Component} from "react";
import {connect} from "react-redux"
import {loadListDataAsyanc} from "./actionCreator"
import TicketList from './ticketList'

import Swiper from "@/components/layout/swiper/swiper"

 class Info extends Component{
    render(){
        return (
            <Fragment>
                <Swiper/>
                <TicketList />
            </Fragment>
        )
    }
    componentDidMount(){
        this.props.handleTest();
    }
}
const mapStateToProps=(store)=>{
    return {
        listData:store.getIn(["infoReducer","listData"])
    }
}
//里面必需返回一个对象
const mapDispathToProps=(dispatch)=>({
    handleTest(){
        dispatch(loadListDataAsyanc(dispatch))
    }
})
export default connect(mapStateToProps,mapDispathToProps)(Info);
// 解决dispatch可以传入一个函数